<!doctype html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <title>CSS Cookbook: center an element</title>
    <link rel="stylesheet" href="styles.css">
    <style>
        .container {
            border: 2px solid rgb(75, 70, 74);
            border-radius: .5em;
        }

        .item {
            border: 2px solid rgb(95, 97, 110);
            border-radius: .5em;
            padding: 20px;
        }
    </style>

    <style class="editable">
        .container {
            height: 200px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .item {
            width: 10em;
        }
    </style>
</head>

<body>
    <section class="preview">
        <div class="container">
            <div class="item">I am centered!</div>
        </div>
    </section>

    <textarea class="playable playable-css" style="height: 170px;">
.container {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item {
    width: 10em;
}
    </textarea>

    <textarea class="playable playable-html" style="height: 70px;">
    <div class="container">
        <div class="item">I am centered!</div>
    </div>
    </textarea>

    <div class="playable-buttons">
        <input id="reset" type="button" value="Reset">
    </div>
</body>
<script src="playable.js"></script>

</html>